package com.ddatsh.transaction.core.model;


import java.io.Serializable;
import java.util.Date;

/**
 * 交易系统请求对像，交易请求均通过该模型调用和请求交易系统
 * 
 * @author ddatsh
 * @version 1.0
 */
public class Request implements Serializable, Comparable<Request> {
	private static final long serialVersionUID = -5539534363467777475L;
	public static final String STATUS_INIT = "000";
	public static final String STATUS_COMPLETE = "100";
	public static final String TRANS_TYPE_SYNC = "0";
	public static final String TRANS_TYPE_ASYN = "1";

	// 请求流水号
	private String requestNo;
	// 业务员，操作员
	private String operatorName;
	// 客户端设备编号
	private String clientId;
	// 请求客户端IP
	private String clientIp;
	// 请求客户端名称
	private String clientName;
	// 服务端ip
	private String serverIp;
	// 服务端名称
	private String serverName;
	// 请求渠道代码
	private String channelCode;
	// 事务流水号
	private String transactionNo;
	// 请求交易编号
	private String transCode;
	// 交易类型:0：同步，1：异步
	private String transType;
	// 请求时间
	private Date requestTime;
	// 请求到达时间
	private Date arrivalTime;
	// 请求主体
	private Object requestBody;
	// 请求主体JSON
	private String requestBodyJson;
	// 状态
	private String status;

	private boolean debug;

	public int compareTo(Request otherRequest) {
		return transCode.compareTo(otherRequest.getTransCode());
	}

	public String getRequestNo() {
		return requestNo;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public String getClientId() {
		return clientId;
	}

	public String getClientIp() {
		return clientIp;
	}

	public String getClientName() {
		return clientName;
	}

	public String getServerIp() {
		return serverIp;
	}

	public String getServerName() {
		return serverName;
	}

	public String getChannelCode() {
		return channelCode;
	}

	public String getTransactionNo() {
		return transactionNo;
	}

	public String getTransCode() {
		return transCode;
	}

	public String getTransType() {
		return transType;
	}

	public Date getRequestTime() {
		return requestTime;
	}

	public Date getArrivalTime() {
		return arrivalTime;
	}

	public Object getRequestBody() {
		return requestBody;
	}

	public String getRequestBodyJson() {
		return requestBodyJson;
	}

	public String getStatus() {
		return status;
	}

	public boolean isDebug() {
		return debug;
	}

	public void setRequestNo(String requestNo) {
		this.requestNo = requestNo;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}

	public void setClientName(String clientName) {
		this.clientName = clientName;
	}

	public void setServerIp(String serverIp) {
		this.serverIp = serverIp;
	}

	public void setServerName(String serverName) {
		this.serverName = serverName;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}

	public void setTransactionNo(String transactionNo) {
		this.transactionNo = transactionNo;
	}

	public void setTransCode(String transCode) {
		this.transCode = transCode;
	}

	public void setTransType(String transType) {
		this.transType = transType;
	}

	public void setRequestTime(Date requestTime) {
		this.requestTime = requestTime;
	}

	public void setArrivalTime(Date arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	public void setRequestBody(Object requestBody) {
		this.requestBody = requestBody;
	}

	public void setRequestBodyJson(String requestBodyJson) {
		this.requestBodyJson = requestBodyJson;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public void setDebug(boolean debug) {
		this.debug = debug;
	}

}
